﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AUV5.Model
{
    public class NetPager
    {
        public enum SqlSortType
        { 
            Asc=1,
            Desc=2,
            Multi=3
        }


        /// <summary>
        /// 表名或视图名
        /// </summary>
        public string TableName { get; set; }
        
        
        private string fieldlist = "*";
        /// <summary>
        /// 字段列表，默认值为*
        /// </summary>
        public string FieldList
        {
            get { return fieldlist; }
            set { fieldlist = value; }
        }
        
        /// <summary>
        /// 主键
        /// </summary>
        public string PrimaryKey { get; set; }
        /// <summary>
        /// 查询条件(不用写关键字where)
        /// </summary>
        public string Where { get; set; }
        /// <summary>
        /// 排序字段（不用加OrderBy,但要加Asc或Desc）
        /// </summary>
        public string Order { get; set; }
        /// <summary>
        /// 排序方式
        /// </summary>
        public int SortType { get; set; }
        
        private int recordcount = 0;
        /// <summary>
        /// 要获取的记录条数,默认值为0返回所有数据
        /// </summary>
        public int RecorderCount
        {
            get { return recordcount; }
            set { recordcount = value; }
        }
        /// <summary>
        /// 每页显示个数
        /// </summary>
        public int PageSize { get; set; }
        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; set; }
        
        private int totalcount = -1;
        /// <summary>
        /// 返回的总记录数
        /// </summary>
        public int TotalCount
        {
            get { return totalcount; }
            set { totalcount = value; }
        }
       
        private int totalpagecount = -1;
        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPageCount
        {
            get { return totalpagecount; }
            set { totalpagecount = value; }
        }
    }
}
